# coding:utf-8
from datetime import date, datetime
from typing import Union

from fastapi import Query
from pydantic import BaseModel, Field


class UploadBase(BaseModel):
    channel: int
    folder_id: int
    uid: int
    type: str
    storage: str
    domain: str
    name: str
    url: str
    ext: str
    size: int


class UploadRename(BaseModel):
    id: int
    name: str


class UploadOutDB(UploadBase):
    """
    管理员信息输出
    """
    id: int  # 主键
    createTime: datetime = Field(alias='createTime')
    updateTime: datetime = Field(alias='updateTime')


class FolderBase(BaseModel):
    pid: int
    name: str
    sort: int


class FolderUpdate(FolderBase):
    id: int
